Find/Replace overlay: encapsulate handling of search option changes#4183
Merged
HeikoKlare merged 1 commit intoJul 14, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request refactors the Find/Replace overlay’s search-option handling by encapsulating option toggling and related UI updates into a specialized action type, and by reshaping the tool-item builder API to make search-option bindings more explicit and fluent. This aligns with issue #1912’s goal of separating UI setup from controller-like logic.
Changes:
- Introduces
FindReplaceOverlaySearchOptionActionto encapsulate toggling ofSearchOptionsand enable UI code to listen to action executions. - Extends
FindReplaceOverlayActionwith execution listeners so the overlay can react (e.g., updating incremental search) after an action runs. - Reworks
AccessibleToolItemBuilderinto a fluent builder with specialized sub-builders for general actions vs. search-option actions (including inverted display).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/findandreplace/overlay/FindReplaceOverlaySearchOptionAction.java | Adds a specialized overlay action for toggling a specific search option via the logic layer. |
| bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/findandreplace/overlay/FindReplaceOverlayAction.java | Adds execution-listener support to notify UI logic after actions run. |
| bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/findandreplace/overlay/FindReplaceOverlay.java | Updates overlay buttons to use the new search-option action and react via execution listeners. |
| bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/findandreplace/overlay/AccessibleToolItemBuilder.java | Refactors builder into fluent sub-builders, including automatic binding for search-option state/availability. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b38f5ef to
0244d91
Compare
The configuration and implementation of search option modifications in the find/replace overlay was scattered across the overlay implementation as well the implementation of logic and the specific UI (tool) items. With this change, the state and execution handling of search option changes is further encapsulated in a specialization of the existing FindReplaceOverlayAction. The UI just listens to changes/executions of this action or the underlying models. In addition, the builder for the tool items for changing the search options is enhanced to a fluent builder that does not implicitly require specific combinations of properties being set. Contributes to eclipse-platform#1912
0244d91 to
494d0bc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The configuration and implementation of search option modifications in the find/replace overlay was scattered across the overlay implementation as well the implementation of logic and the specific UI (tool) items.
With this change, the state and execution handling of search option changes is further encapsulated in a specialization of the existing FindReplaceOverlayAction. The UI just listens to changes/executions of this action or the underlying models.
In addition, the builder for the tool items for changing the search options is enhanced to a fluent builder that does not implicitly require specific combinations of properties being set.
Contributes to #1912